print('趣味数字猜猜')
import random
shuzi = random.randint(0,40)
count = 0
if shuzi > 0 and shuzi < 40:
    while True:
        if count <4:
            guess = input('请输入你猜想的数字：')
            guess_digit = int(guess)
            if guess_digit == shuzi:
                print('恭喜你，只用一次就猜中了！')
                break
            elif guess_digit < shuzi:
                print('猜的数字太小了！')
            else:
                print('猜的数字太大了！')
            count +=1
        else:
            print('小笨蛋，猜那么多次都没猜中！')
            print('正确答案是:%s'%(shuzi))
            break
else:
    print('请输入数字在0-40之间的数字')